package com.yihr.bean;

import java.time.Instant;
import java.util.Map;

public class TokenRes {
    // true = 不是在此之前
    private boolean isNbf;

    // true = is exp 过期
    private boolean isExp;

    // true = outtime， 需要重新获取
    private boolean isOutTime;

    Map<String, Object> mapBody;

    public TokenRes(long nbf, long exp, long outtime, Map<String, Object> mapBody) {
        long second = Instant.now().getEpochSecond();
        this.isNbf = second > nbf;
        this.isExp = second < exp;
        this.isOutTime = second > outtime;
        this.mapBody = mapBody;
    }

    public boolean isNbf() {
        return isNbf;
    }

    public boolean isExp() {
        return isExp;
    }

    public boolean isOutTime() {
        return isOutTime;
    }


    public Map<String, Object> getMapBody() {
        return mapBody;
    }

}
